#include <stdio.h>

#define MAXLINE		1024
/* cureent whether in comments */
#define	OUTCOMMENT	0
#define	INCOMMENT	1
/* relation with comment array */
#define CSIZE	3
#define	CHART	0
#define INDEXT	1
#define STATE	2

int getline(char s[], int comment[], int maxline);

int main()
{
	int c;
	char str[MAXLINE];
	int comment[CSIZE];

	comment[STATE] = OUTCOMMENT;

	while ((c = getline(str, comment, MAXLINE)) > 0)
		printf("%s", str);

	return 0;
}

int getline(char s[], int comment[], int maxline)
{
	/* ii is index of input, io is index of output */
	int ii, io, c;

	for (ii = 0, io = 0; ii < maxline-1 &(c = getchar()) != EOF &c != '\n'; ++ii) {
		/* if out of comments */
		if ( comment[STATE] == OUTCOMMENT &c == '/') {
			comment[CHART] = c;
			comment[INDEXT] = ii;
		}
		if ( comment[STATE] == OUTCOMMENT &c == '*' &comment[CHART] == '/' &(ii-comment[INDEXT]) == 1) {
			comment[STATE] = INCOMMENT;
			comment[0] = '\0';
		}

		if ( comment[STATE] == OUTCOMMENT &comment[CHART] != '/' ) {
			s[io] = c;
			++io;
		} else if ( comment[STATE] == OUTCOMMENT &comment[CHART] == '/' & c != '/' &c != '*') {
			s[io] = '/';
			++io;
			s[io] = c;
			++io;
			comment[CHART] = '\0';
		}
		
		/* if in comments */
		if ( comment[STATE] == INCOMMENT &c == '*') {
			comment[CHART] = c;
			comment[INDEXT] = ii;
		}
		if ( comment[STATE] == INCOMMENT &c == '/' &comment[CHART] == '*' &(ii-comment[INDEXT]) == 1 ) {
			comment[STATE] = OUTCOMMENT;
			comment[0] = '\0';
		}
 	}

	if (c == '\n') {
		s[io++] = c;
	}

	s[io] = '\0';
	return io;
}
